package io.vanaheimr.account.repository;

import io.micronaut.data.annotation.Repository;
import io.micronaut.data.model.query.builder.sql.Dialect;
import io.micronaut.data.r2dbc.annotation.R2dbcRepository;
import io.micronaut.data.repository.CrudRepository;
import io.micronaut.data.repository.jpa.JpaSpecificationExecutor;
import io.vanaheimr.account.Account;
import io.vanaheimr.account.Account_;

@Repository
@R2dbcRepository(dialect = Dialect.H2)
public interface AccountRepository extends CrudRepository<Account, Long>, JpaSpecificationExecutor<Account> {
    default void test() {
//        findOne(((root, criteriaBuilder) -> criteriaBuilder.equal(root.get(Account_), "test")));
        findOne((root, criteriaBuilder) ->
                criteriaBuilder.equal(root.get(Account_.NAME), "test")
        );
    }

}
